public class Test12 {
    public static void main(String[] args) {
        int[][] a = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
        int[][] b = new int[3][3];
        int k = 1;
        for (int i = 0; i < b.length; i++) {
            for (int j = 0; j < b[i].length; j++)
                b[i][j] = k++;
        }
        System.out.println("输出数组a");
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a[i].length; j++)
                System.out.println(a[i][j]);
        }
        System.out.println("输出数组b");
        for (int i = 0; i < b.length; i++) {
            for (int j = 0; j < b[i].length; j++)
                System.out.println(b[i][j]);
        }
    }
}